package com.zoro.barn.commons.foundation.exceptions;


import com.zoro.barn.commons.foundation.constants.web.ResponseConstants;

/**
 * system exception ,
 *
 * @author zhaoxingwu
 */
public class BusinessException extends RuntimeException {
    private String code;

    public BusinessException(String message, String code) {
        super(message);
        this.code = code;
    }

    public BusinessException(String message) {
        super(message);
        this.code = ResponseConstants.STATUS_ERROR;
    }

    public BusinessException(String message, Throwable cause, String code) {
        super(message, cause);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
        this.code = ResponseConstants.STATUS_ERROR;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
